package com.forenow.demo.ListTest;
import java.util.ArrayList;
import java.util.List;
public class Count {
    public static void main(String[] args) {
        String[] s={"aaa","ccc","vvv","nnn","aaa","ccc","vvv","ddd","eee","eee","ddd","ccc","aaa","vvv","nnn"};
        int a=0,c=0,v=0,n=0,d=0,e=0;
        List<String> slist=new ArrayList<>();
        for (int i = 0; i < s.length; i++) {
            slist.add(s[i]);
        }
        for (int j = 0; j <slist.size() ; j++) {
            if (slist.get(j).contains("aaa")) {
                a++;
            }
            if (slist.get(j).contains("ccc")) {
                c++;
            }
            if (slist.get(j).contains("vvv")) {
                v++;
            }
            if (slist.get(j).contains("nnn")) {
                n++;
            }
            if (slist.get(j).contains("ddd")) {
                d++;
            }
            if (slist.get(j).contains("eee")) {
                e++;
            }
        }
        System.out.println("aaa:"+a);
        System.out.println("ccc:"+c);
        System.out.println("vvv:"+v);
        System.out.println("nnn:"+n);
        System.out.println("ddd:"+d);
        System.out.println("eee:"+e);
    }
}
